﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TienTeTuong
{
    public partial class AjaxMail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string email = Request.QueryString["email"];
            var bus = new ReceiveemailBUS();
            if(bus.CheckEmailExist(email))
            {
                Response.Write("exist"); // email exist;
                return;
            }
            var rec = new ReceiveemailDTO();
            rec.Email = email;
            rec.Active = true;
            Response.Write(bus.AddNewReceiveEmail(rec) ? "ok" : "fail");
        }
    }
}